package com.heima.article.feign;

import com.heima.model.behavior.pojo.ApBehaviorEntry;
import com.heima.model.behavior.pojo.ApLikesBehavior;
import com.heima.model.behavior.pojo.ApUnlikesBehavior;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient("leadnews-behavior")
public interface BehaviorFeign {

    @GetMapping("/api/v1/behavior/findOne/{userId}/{equipmentId}")
    ApBehaviorEntry findByUserIdOrEquipmentId(@PathVariable("userId") Integer userId, @PathVariable("equipmentId") Integer equipmentId);

    /**
     * 根据文章id和实体id查询
     * @param entryId
     * @param articleId
     * @return
     */
    @GetMapping("/api/v1/likeBehavior/getlike/{entryId}/{articleId}")
     ApLikesBehavior getlike(@PathVariable("entryId") Integer entryId, @PathVariable("articleId") Long articleId);

    /**
     * 根据文章id和实体行为id查询
     * @param entryId
     * @param articleId
     * @return
     */
    @GetMapping("/api/v1/unLikeBehavior/getUnlike/{entryId}/{articleId}")
    public ApUnlikesBehavior getUnlike(@PathVariable("entryId") Integer entryId, @PathVariable("articleId") Long articleId);
}